import React, {Component} from 'react';
import "./root.css";
import {HashRouter, Route, Routes} from "react-router-dom";
import Article from "../article/Article";
import OxGame from "../oxGame/OxGame";
import Demo from "../demo1/Demo";
import ControlDemo from "../demo1/ControlDemo";
import Calculator from "../demo1/Calculator";
import UncontrollableComponentDemo from "../demo1/UncontrollableComponentDemo";
import App from "../App";
import history from './history'


/**
 * 这里包名index必须配合下面方式引用, 别的完蛋. 像本文件头部的import方式不能命名为index包, indexx都可以的
 * let Index = lazy(() => import("./views/index/Index.jsx"));
 */
class MyRouter extends Component {
    render() {
        return (
            <HashRouter>
                <Routes>
                    <Route path="/" element={<App/>}>
                        <Route index element={<Article/>}/>
                        <Route index path="article" element={<Article/>}/>
                        <Route path="game" element={<OxGame/>}/>
                        <Route path="demo" element={<Demo/>}/>
                        <Route path="controlDemo" element={<ControlDemo/>}/>
                        <Route path="temperatureDemo" element={<Calculator/>}/>
                        <Route path="uncontrollableComponentDemo" element={<UncontrollableComponentDemo/>}/>
                    </Route>
                </Routes>
            </HashRouter>
        );
    }
}

export default MyRouter;